﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogicLayer;
using System.Windows;
using DataAccessLayer;

namespace Maintain_supplier_information
{
    public partial class MaintainSupplierInfo : System.Web.UI.Page
    {
        SupplierBizlogic sbl = new SupplierBizlogic();
        protected void Page_Load(object sender, EventArgs e)
        {
        }


        protected void btn_submit_Click(object sender, EventArgs e)
        {
            StationeryInventoryEntities1 r = new StationeryInventoryEntities1();
            Supplier sup = new Supplier();
            List<string> st = new List<string>();

            st = sbl.getDepId();
            if (st.Contains(txt_supplierid.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Duplication of values')", true);
                lbl_status.Text = "Dupication of values";
            }
            else
            {
                bool ans = false;
                ans = sbl.savesupplier(txt_supplierid.Text, txt_suppliername.Text, txt_contactname.Text, txt_phoneno.Text, txt_faxno.Text, txt_gstregno.Text, txt_address.Text, txt_email.Text);
                if (ans == true)
                { lbl_status.Text = "Added"; }
                else
                {
                    lbl_status.Text = "ERROR";
                }
            }
        }




    }
}









